Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

422
Views
How do I make it so that [Long] is read as a number?

I've successfully retrieved a stopTimeUpdate from the MTA GTFS Realtime feed using this code:

const Long = require("long");
const GtfsRealtimeBindings = require('gtfs-realtime-bindings');
const request = require('request');

var requestSettings = {
  headers: { 'x-api-key': 'NiLi4PZxxxxxxxxxxxxxxxxxxxxxcvCzODm' },
  method: 'GET',
  url: 'https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-g',
  encoding: null
};
request(requestSettings, function (error, response, body) {
  if (!error && response.statusCode == 200) {
    var feedMessage = GtfsRealtimeBindings.transit_realtime.FeedMessage.decode(body);
    feedMessage.entity.forEach(function(entity) {
      if (entity.tripUpdate) {
        console.log(entity.tripUpdate.stopTimeUpdate);
      }
      
    });
  }
});

with an output of:

StopTimeUpdate {
    arrival: StopTimeEvent { time: [Long] },
    departure: StopTimeEvent { time: [Long] },
    stopId: 'F27S'
  }

How do I make it so that [Long] is read as a number?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!